package main

import "fmt"

type Vistor struct {
	Name string
	Age  int
}

func (vistor *Vistor) getPrice() {
	if (*vistor).Age <= 6 || (*vistor).Age >= 70 {
		fmt.Println("为了安全，暂无法入内")
		return
	}
	if (*vistor).Age >= 18 {
		fmt.Println("成年了 票价20")
	} else {
		fmt.Println("free")
	}
}

func main() {
	var vistor Vistor
	for {
		fmt.Println("请输入名字")
		fmt.Scanln(&vistor.Name)
		if vistor.Name == "out" {
			break
		}
		fmt.Println("请输入年龄")
		fmt.Scanln(&vistor.Age)
		(&vistor).getPrice()
	}
}
